-
Notifications
You must be signed in to change notification settings - Fork 9
fix: Update children's states to ready even if some children are not ready (fixes #147). #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe SQL update query in the Changes
Sequence Diagram(s)sequenceDiagram
participant MySqlMetadataStorage
participant MySQL DB
MySqlMetadataStorage->>MySQL DB: Update tasks to 'ready' where dependencies are met (using NOT IN)
MySQL DB-->>MySqlMetadataStorage: Acknowledge updated rows
Possibly related issues
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/spider/storage/mysql/MySqlStorage.cpp (1)
1641-1646: SQL query logic is correct but consider NULL handling with NOT IN.The modified query correctly implements the intended behaviour to update only those dependent tasks to 'ready' state that have all their inputs available, while leaving tasks with missing inputs in 'pending' state. This aligns well with the PR objective.
However, be aware that
NOT INcan behave unexpectedly if the subquery returns anyNULLvalues - the entireNOT INexpression would evaluate toUNKNOWNfor all rows. Sincetask_idis likely a non-null primary/foreign key, this shouldn't be an issue here, but it's worth noting for future SQL modifications.Consider adding a comment explaining the complex nested subquery logic for future maintainability:
// Set task states to ready if all inputs are available + // Update dependent tasks to ready state, excluding those with missing inputs std::unique_ptr<sql::PreparedStatement> ready_statement(
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/spider/storage/mysql/MySqlStorage.cpp(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: lint
- GitHub Check: non-storage-unit-tests (ubuntu-22.04)
- GitHub Check: non-storage-unit-tests (ubuntu-24.04)
Description
MySQL
task_finishimplementation only updates children's state to ready if all children are ready. This pr fixes the problem by updating the states of ready children and leave non-ready children's state as pending.Checklist
breaking change.
Validation performed
Summary by CodeRabbit